CMS / Coding / Dashboard role based
User Role Based Dashboard
-
DB
-
Query
$features=[]; $dashboardFatures=DashboardRoleRelation::join('dashboard_settings','dashboard_settings.id','dashboard_role_relationss.dashboard_id')->where('role_id',$user->role_id)->get(); if(isset($dashboardFatures)){ foreach($dashboardFatures as $row){ switch($row->dashboard_identifier){ case 'target_panel': $features['target_panel']=['declared_target'=>$delared_taget, 'achieved_target'=>'0', 'days_left'=>$days_left]; break; } } }